import httpRequest from "@/utils/request.ts";
import type {LoginPassResType, LoginStateType} from "@/types/loginType.ts";
import type {UserFormSearchType, UserItemType} from "@/types/userType.ts";
import type {PageQueryType, PageResType} from "@/types/commonType.ts";

// httpRequest
export const systemApi = {
    // 账号密码登录
    passLogin: (data: LoginStateType) => httpRequest.post<LoginPassResType>('/passLogin', data),

    // 下载导入模板
    downloadImportTemplate: (name: string) => httpRequest.download('/download/template?name=' + name),

    /**
     * 用户接口
     */
    // 分页查询用户列表
    // >
    userPageList: (data: PageQueryType<UserFormSearchType>) => httpRequest.post<PageResType<UserItemType>>('/system/user/pageList', data)
}